package zoo;

// 饲养员
public class Feeder {
    public String name;

    public Feeder(String name) {
        this.name = name;
    }

    // 喂饭
    public void feedAnimal(Animal animal) {
        if (animal instanceof Dog) {
            System.out.println("小飞棍给狗磨牙");
        }
        animal.eat();
    }

    public void feedAnimal(Animal[] arr) {
        for (int i = 0; i < arr.length; i++) {
            arr[i].eat();
        }
    }

}
